import React from 'react';
import { CourerDiv } from './StyleCourse'
import { useHistory } from 'react-router-dom'

const Courselist = (props) => {
    let history = useHistory()
    return (
        <CourerDiv>
            <div className='listBox'>
                <ul>
                    {
                        props.list.length > 0 && props.list.map(v => {
                            return (
                                <li onClick={() => history.push('/preview',v.mkIds)} key={v.creatDate}>
                                    <div>
                                        <img src={ 'http://9z4nm9.natappfree.cc' + v.kjFengMian} alt="" />
                                    </div>
                                    <div>
                                        <h2>{v.kjName}</h2>
                                        <p><span>{v.creatDate}</span><i>16:50:25</i></p>
                                    </div>
                                </li>
                            )
                        })
                    }
                </ul>
            </div>
        </CourerDiv>
    );
}

export default Courselist;